import 'package:flutter_oldman_health/models/response_data_model.dart';

class UploadPhotoModel extends ResponseDataModel<UploadPhoto> {
  UploadPhotoModel({int code, String msg, UploadPhoto data})
      : super(code: code, msg: msg, data: data);

  factory UploadPhotoModel.fromJson(Map<String, dynamic> json) {
    return UploadPhotoModel(
        code: json["code"],
        msg: json["msg"],
        data: UploadPhoto.fromJson(json["data"]));
  }
}

class UploadPhoto {
  //         "id" : "xxxxx", // 文件id
  //         "filename" : image.png, // 上传文件名
  //         "size" : 123456, // 大小，单位 B
  //         "path" : "qisyun/xxx/xxx/image.png",  // 图片相对路径
  //         "category" : "health",
  //         "inDate" : 1632973220728 // 上传时间
  //         "inUser" : "2edebb34b6bd4dadb9a4325773a73f50"  // 上传人
  String id;
  String filename;
  int size;
  String path;
  String category;
  int inDate;
  String inUser;

  UploadPhoto(
      {this.id,
      this.filename,
      this.size,
      this.path,
      this.category,
      this.inDate,
      this.inUser});

  factory UploadPhoto.fromJson(Map<String, dynamic> json) {
    return UploadPhoto(
        id: json["id"],
        filename: json["filename"],
        size: json["size"],
        path: json["path"],
        category: json["category"],
        inDate: json["inDate"],
        inUser: json["inUser"]);
  }
}
